package com.app.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;

import java.sql.Timestamp;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * 评论
 * @author 16693103420
 * @since 2024-01-22
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("tb_comment")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class CommentModel implements Serializable {
    @TableId(type = IdType.AUTO)
    private Integer id;//评论表ID
    private String content;//评论内容
    private Integer score;//得分1-5 1 2 3 4 5 最高5
    private String openId;//用户唯一id
    private Integer relationId;//关联被评论对象Id
    private Integer commentType;//评论类型2 好评 3中评 4差评
    private String fileId;//文件ID
    private String orderId;//订单ID

    @TableField(exist = false)
    private String scoreText;//转义 45好评  3中评  12差评

    @TableField(exist = false)
    private String userName;//用户名称
    @TableField(exist = false)
    private String faveUrl;//用户头像

    @TableField(exist = false)
    private List<String> url;//图片
    @TableField(exist = false)
    private List<String> urlList;


    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") //后端注解格式化日期
    private Timestamp createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") //后端注解格式化日期
    private Timestamp updateTime;

}
